package jiakuang2;
import java.util.HashMap;
import java.util.Map;
public class study {
    private int i;
    private int j;
    //无参构造方法
    public study() {
    }
//有参构造方法
    public study(int i,int j) {
        this.i = i;
        this.j=j;
    }

    public static void main(String[] args) {
        //创建集合
        Map study=new HashMap();
        //创建数据
        study th=new study(1,1);
        study th1=new study(2,2);
        study th2=new study(3,3);
       //添加数据
        study.put(1,1);
        study.put(2,2);
        study.put(3,3);
        //遍历
        int sum=0;
        int count=0;
        for(Object O:study.values()){
            sum+=(int)O;
            count=sum/study.size();
        }
        System.out.println("和为:"+sum);
        System.out.println("平均分为:"+count);
    }
}
